package microservicedemo.bookclient.Client;

import lombok.extern.slf4j.Slf4j;
import microservicedemo.bookclient.model.Book;
import org.springframework.stereotype.Component;

@Slf4j
@Component
public class BookServiceFallback implements BookServiceClient {
    @Override
    public boolean addBook(Book book) {
        log.info("addBook fallback");
        return false;
    }

    @Override
    public boolean delBook(Book book) {
        log.info("delBook fallback");
        return false;
    }

    @Override
    public boolean editBook(Book book) {
        log.info("editBook fallback");
        return false;
    }

    @Override
    public Book getByTitle(String title) {
        log.info("getByTitle fallback");
        Book book = new Book();
        book.setTitle("error");
        return book;
    }

    @Override
    public Book getByAuthor(String author) {
        log.info("getByAuthor fallback");
        Book book = new Book();
        book.setTitle("error");
        return book;
    }
}
